pub fn new_birthday_probability(n: u32) -> f64 {
    assert!(n >= 2);

    let mut prob_all_different = 1.0;
    let days_in_year = 365.0;

    for i in 0..n {
        prob_all_different *= (days_in_year - i as f64) / days_in_year;
    }

    // 计算至少两人生日相同的概率
    let prob_at_least_two_same = 1.0 - prob_all_different;
    (prob_at_least_two_same * 10000.0).round() / 10000.0  // 保留四位小数
}
